import cv2
import numpy as np
from pyzbar.pyzbar import decode

img = cv2.imread("Resources/wechat2.png")
# cap = cv2.VideoCapture("Resources/Qr.mp4")

while True:
    # success, img = cap.read()
    code = decode(img)
    for barcode in code:
        rect_temp = barcode.rect
        cv2.rectangle(img,rect_temp,(0,0,255),2)
        mydata = barcode.data.decode("utf-8")
        cv2.putText(img,mydata,(rect_temp[0],rect_temp[1]),cv2.FONT_HERSHEY_SIMPLEX,0.6,(0,0,255),2)

    print(code)
    cv2.imshow("Result",img)
    cv2.waitKey(1)
















